#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
using namespace std;

int a[100010], c[100010];
bool mp[20][20];

int main() {
    freopen("arena.in", "r", stdin);
    freopen("arena.out", "w", stdout);
    int t;
    cin >> t;
    while (t--) {
        int n, m;
        cin >> n >> m;
        for (int i = 1; i <= n; i++) cin >> a[i];
        for (int i = 1; i <= m; i++) cin >> c[i];
        int k = ceil(log2(n));
        for (int i = 1; i <= k; i++) {
            string s;
            cin >> s;
            for (int j = 0; j <= s.size() - 1; j++) mp[i][j + 1] = (s[j]== '1');
        }
        while (t--) {
            int x1, x2, x3, x4;
            cin >> x1 >> x2 >> x3 >> x4;

        }
    }
    return 0;
}
